home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1997 August
/
Walnut Creek CDROM.7z
/
VOL_400
/
446_01
/
DOC
/
DPBASICS
/
ODE
/
TIMELOOP.C
< prev
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1996-04-18
|
307 b
|
13 lines
#include <ode.h>
void timeLoop (ODESolver* solver, Vec(real)& y, real dt, real t_end)
{
Os ofile ("FILE=ppp"); // write results to file "ppp"
real t = 0;
while (t < t_end)
{
solver->advance (y, t, dt); // update y and t (and possibly dt)
ofile << t << " " << y(1) << '\n';
}
}